<template>
    <div class="swiper-container" ref="swiper">
        <div class="swiper-wrapper">
            <div class="swiper-slide" v-for="(img,index) in imgs" :key="index">
                <img :src="img" alt="">
            </div>
        </div>
         <div class="swiper-pagination" ref="pagination">
         </div>
    </div>
</template>

<script>
import swiper, { Pagination, Autoplay } from 'swiper'
import 'swiper/swiper-bundle.min.css'

// 给swiper安装功能
swiper.use([Pagination, Autoplay])

export default {
    props:['imgs'],
    data() {
        return {
            list: []
        }
    },
    mounted() {
        // console.log(imgs);
         this.$nextTick(()=>{
                new swiper(this.$refs.swiper, {
                    autoplay:{
                        delay: 1500,
                        speed: 1000,
                    },
                    loop:true,
                    pagination:{
                        el:this.$refs.pagination,
                        clickable :true,
                    }
                })
            })
    }
}
</script>

<style lang="scss" scoped>
.swiper-container {
    width: 100%;
    height: 100%;
}
.swiper-wrapper{
    box-sizing: border-box;
}
.swiper-slide{
    img{
        width: 100%;
        height: 100%;
    }
}
.swiper-pagination{
    bottom: 130px;
}
/deep/ .swiper-pagination-bullet{
    width: 40px;
    height: 3px;
    border-radius: 0;
    background: #152250;
}
/deep/ .swiper-pagination-bullet-active{
    background: #02e58a;
}
</style>